package rdd01.action

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Spark_Action_Jiehe {
  def main(args: Array[String]): Unit = {
    val sparkConf=new SparkConf().setMaster("local[*]").setAppName("wordCount")
    val sc=new SparkContext(sparkConf)
    val rdd=sc.makeRDD(List(1,2,3,4))
    val user=new User()
    rdd.foreach(
      num=>{
        println("age="+(user.age+num))
      }
    )

    sc.stop()
  }
  class User extends Serializable{
    var age:Int=30
  }


}
